﻿using System;
using System.Collections.Generic;
using System.Text;
using PacMan3D.Exceptions;
using Tao.OpenGl;
using Tao.DevIl;
using System.IO;

namespace PacMan3D.Utils
{
    public class ResourceLoader
    {
        public static int LoadResource(string resource)
        {
            if (!File.Exists(resource))
                throw new ResourceFileException(resource);

            Gl.glEnable(Gl.GL_TEXTURE_2D);
            Ilut.ilutGLLoadImage(resource);
            int id = Ilut.ilutGLBindTexImage();
            Gl.glDisable(Gl.GL_TEXTURE_2D);
            return id;
        }
    }
}
